#include <stdio.h>

int main()
{
	int n,i,square,process;
	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
		process = i * n;
		for (int j=process - n + 1 ; j<=process  ; j++)
		{
			printf("%3d",j);
		}
		printf("\n");
	}
	return 0;
}